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

Query time 0.00029