UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RNUxRhmnSrY3AiATC3JGFfW2j/U2o9K++S91kn/wS1c=' 
WHERE 
  key_id = 'cd99ad229822b6599cc8e84ecfcf6a376c9ddd3e6ce754a5003335870f7e40b6' 
  AND (
    token = 'RNUxRhmnSrY3AiATC3JGFfW2j/U2o9K++S91kn/wS1c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026