UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iDORL8VZu7wc90QIUTNw/4IzieG1ztQ0zV/C8x8OH3c=' 
WHERE 
  key_id = '3e443de0601c7abf9b0c805975b5389350949c55e5b8179cea6afea375147323' 
  AND (
    token = 'iDORL8VZu7wc90QIUTNw/4IzieG1ztQ0zV/C8x8OH3c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049