UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZL6RPj9rjWVwMIlnooAOwswQW64THZ+KkgrYt1HdFKw=' 
WHERE 
  key_id = 'fb84ca0d95d5b75b658bebfd186f3e7d73714ec9be3faba3cc8d5d2dd5b723e8' 
  AND (
    token = 'ZL6RPj9rjWVwMIlnooAOwswQW64THZ+KkgrYt1HdFKw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051