UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cv+cYyJ+wzTp3bF0+PKAunzEMEuXbbFB+UZ480fIbZY=' 
WHERE 
  key_id = 'dc8c7d7398c95338f85a5b0b388ffb0b058ca2c9c76ade5cdc475be0ea8ed20d' 
  AND (
    token = 'cv+cYyJ+wzTp3bF0+PKAunzEMEuXbbFB+UZ480fIbZY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047