UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X8DWobs2FFIEQQ63/ypuESNhvVgXRczdK9OXljbTLQI=' 
WHERE 
  key_id = 'dcf6c59274944c98be0725253e857005fc2c4d5ac05fc81b49292568913e0832' 
  AND (
    token = 'X8DWobs2FFIEQQ63/ypuESNhvVgXRczdK9OXljbTLQI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037