UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l55prquDZRtdazPvkkTrUsRUGSYfhkQlkEIpvVemYhs=' 
WHERE 
  key_id = '5fedc05e7eda96b6455dd44525216681023a6aa5ecf2b1f367ec9c8b67706c41' 
  AND (
    token = 'l55prquDZRtdazPvkkTrUsRUGSYfhkQlkEIpvVemYhs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018