UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LOjStNYaxqtc9JvI+D+fVR3A/xxkD7o9kKgFOlD75vU=' 
WHERE 
  key_id = '9b07f91667aaf229bc8692d2004bb2a14255279828b40257473cfcab4d81ee95' 
  AND (
    token = 'LOjStNYaxqtc9JvI+D+fVR3A/xxkD7o9kKgFOlD75vU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031