UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rHZ6yN9mZSWup5LHIxzTGsPpx1+UhysXZa98rCplnP8=' 
WHERE 
  key_id = '59c39b03202f61730cf6f79d49d9732d3ec2a09fb41b2964bfd07e0abe1c72e2' 
  AND (
    token = 'rHZ6yN9mZSWup5LHIxzTGsPpx1+UhysXZa98rCplnP8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021