UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RWI89hTIGWdcQzZv5wcHRKdbNDmzZODoea9uQ1cADmI=' 
WHERE 
  key_id = '8215030e59e6f60c5281641d400b760caf77c610d58f09c4c2e16baa68a1a1c2' 
  AND (
    token = 'RWI89hTIGWdcQzZv5wcHRKdbNDmzZODoea9uQ1cADmI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051