UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '62k05kQy5eKkhFCCMc2umZQFfBsLBHE07Uyty9bWD+g=' 
WHERE 
  key_id = 'ee62c859633ba2b1301e7c2a110967f859c10f476d7b0138ba1503f3274e6bcc' 
  AND (
    token = '62k05kQy5eKkhFCCMc2umZQFfBsLBHE07Uyty9bWD+g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032