UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CFl0eXRxcKSCMz/gkC8gGyvlHUxEgQA2AbmPt1SXNtc=' 
WHERE 
  key_id = '7abb7a6643c8f414b12a983f29de611296f8a9ad8bf6c4a5ed210754406011c6' 
  AND (
    token = 'CFl0eXRxcKSCMz/gkC8gGyvlHUxEgQA2AbmPt1SXNtc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034