UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IRenEv2mhNkzz3Q9cP8PJOSpBozbYBamNxZZjlnMUEs=' 
WHERE 
  key_id = '1eb0da8e700f9a16feaf9d749a103a1259aefa0b11eea038b20e58b441047a7a' 
  AND (
    token = 'IRenEv2mhNkzz3Q9cP8PJOSpBozbYBamNxZZjlnMUEs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044