UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k+SjbveoJBGgFAHR5Ja8pTR4isIXppk0Qb9v32g37jE=' 
WHERE 
  key_id = '902b68d654e1c4d69de31f2eeb138e2f2f0a6e1ab836e53883494dd91011063b' 
  AND (
    token = 'k+SjbveoJBGgFAHR5Ja8pTR4isIXppk0Qb9v32g37jE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017