UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HzWHKmFvv+qGhFFkMF8nde+M5Np+g9/fuxxUQJT5v6U=' 
WHERE 
  key_id = '68a5afb7faee3a892a04267a2dbfa02e19db4d836ae622cdb5029b2338429a2f' 
  AND (
    token = 'HzWHKmFvv+qGhFFkMF8nde+M5Np+g9/fuxxUQJT5v6U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032