UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HtD6DQ2RctHAyGgRKGs4APot95v+3QvP6ivU6oD1wxY=' 
WHERE 
  key_id = '921534c52a87e1a39c2daeec1b4b30cb98c17432f5b67c76974f86fc8def7a92' 
  AND (
    token = 'HtD6DQ2RctHAyGgRKGs4APot95v+3QvP6ivU6oD1wxY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035