UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ENnJfPVhOVqxtzUWG1NtlTVBQJwkdW0qC0tIqRHlzy0=' 
WHERE 
  key_id = '0d34ae28eeeaaea283807dfae1f3b0421c53e01736a1a202ef115afb014740c6' 
  AND (
    token = 'ENnJfPVhOVqxtzUWG1NtlTVBQJwkdW0qC0tIqRHlzy0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029