UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TlNyAMfwzq77tm7VZryzGFMxs8NtdFnMnAn5pQLpysI=' 
WHERE 
  key_id = '88c7c9c16f458c7f3fdeb81cacc4c2384a5662cd49f1627c2c8da585a2fc4621' 
  AND (
    token = 'TlNyAMfwzq77tm7VZryzGFMxs8NtdFnMnAn5pQLpysI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019