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

Query time 0.00029