UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g4h1o3Jg8NtVcs2/dRsOwnBFx8YQ2/XRhgbHNGca53k=' 
WHERE 
  key_id = 'f6f6a415413a6d1aeecc3c3852d6c55b40279de5c98250faa80d2f220a72a4e1' 
  AND (
    token = 'g4h1o3Jg8NtVcs2/dRsOwnBFx8YQ2/XRhgbHNGca53k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029