UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FAaqII1XyuPxBf5xcZmC8o7MLvu2hsp5NCsAS0UazQU=' 
WHERE 
  key_id = '9d7dbb7c881d25119cdc8faa99b7d752d31b0dc87a4c09b024cb1b46331f57d5' 
  AND (
    token = 'FAaqII1XyuPxBf5xcZmC8o7MLvu2hsp5NCsAS0UazQU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041