UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cFn81T7Zu2xEtgpXFZ+GZz+YVhxW6wHwIINlABwCDrQ=' 
WHERE 
  key_id = '852008ee960c049579f3330bdc629bb51d7c101228b989d7c3d2cadb05d65d90' 
  AND (
    token = 'cFn81T7Zu2xEtgpXFZ+GZz+YVhxW6wHwIINlABwCDrQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020