UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mTtu3680cucHlY9VPlLSWSc/dNAIHtOzxivgMCXHbL8=' 
WHERE 
  key_id = '503881d8c9049e1c2647beab4ffbf7a82bf8ceab2f579713e40d5ba86879d498' 
  AND (
    token = 'mTtu3680cucHlY9VPlLSWSc/dNAIHtOzxivgMCXHbL8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027