UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HcCcipUqJYEfh1FhUfrb6rvalZz3jQFCrwZpzR2aDAo=' 
WHERE 
  key_id = '035fa0f1b64f68f389a651966f2510808a020e6376069ed427e740d6ac4a3ba4' 
  AND (
    token = 'HcCcipUqJYEfh1FhUfrb6rvalZz3jQFCrwZpzR2aDAo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017