UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N3225lUDAZg8F6mQzON6qkXXHNu+0xaB6hCj21s8GnI=' 
WHERE 
  key_id = '27d688f70e04c2682c0fb3d52e64e6c5e0595356990ba6b313b8b897e0134131' 
  AND (
    token = 'N3225lUDAZg8F6mQzON6qkXXHNu+0xaB6hCj21s8GnI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052