UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9YS8W5rW6OOEjjggujS69gf5G5RsrN9Sc3qpUNZGLJQ=' 
WHERE 
  key_id = '8a298fab7005c2a40c15a1f39069f81fbf4bdba365553f3c42db7133dabffbf2' 
  AND (
    token = '9YS8W5rW6OOEjjggujS69gf5G5RsrN9Sc3qpUNZGLJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054