UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/etXAZlUZgqA8WorPSTZrHm/+tL7j+b2AHKKrVtxMd8=' 
WHERE 
  key_id = '87199781f19df1da2ef29286984864765866f4760dd0bdc3d863ae972b16941c' 
  AND (
    token = '/etXAZlUZgqA8WorPSTZrHm/+tL7j+b2AHKKrVtxMd8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017