UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EBhHBv9RhIcnS2JRk1wpJ4zu4zeNxDka4AOeREefkrM=' 
WHERE 
  key_id = '9db541fea0b373ee2be07dd6be6fad0f32504693515bc34100e54d7e31501ccb' 
  AND (
    token = 'EBhHBv9RhIcnS2JRk1wpJ4zu4zeNxDka4AOeREefkrM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037