UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lZOtaMBDMcKggfe2CE7DDA66W6KYBORpbAdXjTCM/ig=' 
WHERE 
  key_id = '4a8f254113ff60573ce522f8d08c516eaa62e1491a4030145aa342613f01aff4' 
  AND (
    token = 'lZOtaMBDMcKggfe2CE7DDA66W6KYBORpbAdXjTCM/ig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051