UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'US5LfFlGJubTJTOFZv1UYCXJWUpF4zY8frY65HonJI8=' 
WHERE 
  key_id = '3625bfe6d49f599ea69b5f91c059cd9ae630f40e4e540e2289750d77de054708' 
  AND (
    token = 'US5LfFlGJubTJTOFZv1UYCXJWUpF4zY8frY65HonJI8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020