UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5/Dq8ZpzN8BrLcFmB30CUzHFEh6aakFxH4hEqqw/O9Y=' 
WHERE 
  key_id = '5c6d3db2d32c018b78e8e6f2fda289246310080b7015ac94f4eae18218f1ab35' 
  AND (
    token = '5/Dq8ZpzN8BrLcFmB30CUzHFEh6aakFxH4hEqqw/O9Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028