UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8+HnnAta5WR0XF0PwMv5HaJggwwoH0RoqOQGp5o+oTw=' 
WHERE 
  key_id = '87a5040b372007523be9b9a1345805a812b92dac9c777cb0831508cb1834b104' 
  AND (
    token = '8+HnnAta5WR0XF0PwMv5HaJggwwoH0RoqOQGp5o+oTw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021