UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+yvnZNlBz5982Ku+p5oqVlw2bE0deLkfbo5WouOEf9c=' 
WHERE 
  key_id = '09d5bc7f7a60fe779dc7e379de6043705841308a1eef92de481e95eb1006b63f' 
  AND (
    token = '+yvnZNlBz5982Ku+p5oqVlw2bE0deLkfbo5WouOEf9c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043