UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5E1/Z8sOK2uOcCfqSv1IjLNVIzXGR4Nr93l5u4WUCKE=' 
WHERE 
  key_id = '526564844e79a3190bdc5a34a9ba05e8586ef0dde88c936714ee00b668051984' 
  AND (
    token = '5E1/Z8sOK2uOcCfqSv1IjLNVIzXGR4Nr93l5u4WUCKE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015