UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ROkI7GpmJCoWT+M1CddLsjpjXORPtlXNaW+oxD5b5QY=' 
WHERE 
  key_id = '6f6f15ef41bb03dfc7c220ddbdfbe6af82997b59f516a70678e4f15d10f99f3b' 
  AND (
    token = 'ROkI7GpmJCoWT+M1CddLsjpjXORPtlXNaW+oxD5b5QY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039