UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H4VGOND4Sjg1/22GUF2bHgFYxieCU0iSXSngIofsIkc=' 
WHERE 
  key_id = '0c12ea91eaaf2ddf68272fa488e417262a854d03430f26fc9eea435e3ef65e25' 
  AND (
    token = 'H4VGOND4Sjg1/22GUF2bHgFYxieCU0iSXSngIofsIkc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033